<?php
	$template->_template_read("System/Design/Templates/upload.html");
	$head->_template_assign("DIR", $_GET["dir"]);
	$template->_template_assign("DIR", $_GET["dir"]);
	$head->_template_assign("TITEL", "Upload");
	// Grundlegende Sprach-Strings-Einsetzen
	$template->_template_assign("CAPTION_UPLD1", (string)$language->legends->value_7);
	$template->_template_assign("CAPTION_UPLD2", sprintf((string)$language->common->value_27,path_compl($_GET["dir"])));
	$template->_template_assign("CAPTION_UPLD3", (string)$language->common->value_28);
	$template->_template_assign("CAPTION_UPLD4", (string)$language->buttons->value_7);
	$template->_template_assign("CAPTION_UPLD5", (string)$language->common->value_26);
	
	if (ALLOW_UPLOAD == true){
		if (isset($_GET["upload"])){
			if ($_GET["upload"] == 1){
				if (move_uploaded_file($_FILES['upfile']['tmp_name'], don3_plus_one($_FILES['upfile']['name'],$_GET["dir"]))){
					oyster_log("SUCCESS", sprintf((string)$language->log_msgs->value_6,$_FILES['upfile']['name']), "Oyster upload.include");
					$head->_template_assign("STATUS", (string)$language->stati->value_4);
					chmod($_GET["dir"].$_FILES['upfile']['name'], 0777 );
					clearstatcache();
				} else {
					oyster_log("ERROR", (string)$language->errors->value_12, "Oyster upload.include");
					$head->_template_assign("ERROR", (string)$language->errors->value_12);
				}
			}
		}
	} else {
		oyster_log("ERROR", $language->errors->value_13, "Oyster upload.include");
		$head->_template_assign("ERROR", $language->errors->value_13);
		$ordner = $_GET["dir"];
		$included = true;
		include("System/Kernel/Includes/index.include.php");
	}
?>